﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:Controls="clr-namespace:HeritageAcademy.Library.Controls" 
    xmlns:HeritageAcademy_Library="clr-namespace:HeritageAcademy.Library" 
    mc:Ignorable="d"
	x:Class="HeritageAcademy.Library.Controls.DetailsView"
	x:Name="UserControl"
	UseLayoutRounding="True"
	d:DesignWidth="1173.126" d:DesignHeight="964.472">
	<UserControl.Resources>
		<Style x:Key="StartCourseButtonStyle" TargetType="{x:Type Button}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.3"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver">
										<Storyboard>
											<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="rectangle">
												<EasingColorKeyFrame KeyTime="0" Value="#FFEB9032"/>
											</ColorAnimationUsingKeyFrames>
											<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="rectangle">
												<EasingColorKeyFrame KeyTime="0" Value="#FFEB7700"/>
											</ColorAnimationUsingKeyFrames>
											<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Offset)" Storyboard.TargetName="rectangle">
												<EasingDoubleKeyFrame KeyTime="0" Value="0.009"/>
											</DoubleAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Pressed"/>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Unfocused"/>
									<VisualState x:Name="Focused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Rectangle x:Name="rectangle" Stroke="Gainsboro">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#FF8D8D8D" Offset="0.004"/>
										<GradientStop Color="#FF5E5E5E" Offset="1"/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
							<Label Content="Продолжить" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" FontSize="13.333" Visibility="Hidden"/>
							<ContentPresenter RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsFocused" Value="True"/>
							<Trigger Property="IsDefaulted" Value="True"/>
							<Trigger Property="IsMouseOver" Value="True"/>
							<Trigger Property="IsPressed" Value="True"/>
							<Trigger Property="IsEnabled" Value="False">
								<Setter Property="Opacity" Value="0.45"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ActionButton" TargetType="{x:Type Button}">
			<Setter Property="OverridesDefaultStyle" Value="True"/>
			<Setter Property="SnapsToDevicePixels" Value="True"/>
			<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
			<Setter Property="Padding" Value="0,0,0,0"/>
			<Setter Property="Cursor" Value="Hand"/>
			<Setter Property="MinHeight" Value="36"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="Auto"/>
							</Grid.ColumnDefinitions>
							<Border x:Name="MouseOverBorder" CornerRadius="2" BorderThickness="0,1" Grid.ColumnSpan="2" Opacity="0" Background="{DynamicResource LogoBackgroundBrush}" />

							<ContentPresenter x:Name="ContentHost" Margin="0,0,20,0" VerticalAlignment="Center"/>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsMouseOver" Value="True">
								<Trigger.EnterActions>
									<BeginStoryboard>
										<Storyboard>
											<DoubleAnimation Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:00" />
										</Storyboard>
									</BeginStoryboard>
								</Trigger.EnterActions>
								<Trigger.ExitActions>
									<BeginStoryboard>
										<Storyboard>
											<DoubleAnimation Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="Opacity" Duration="00:00:00" />
										</Storyboard>
									</BeginStoryboard>
								</Trigger.ExitActions>
								<Setter TargetName="ContentHost" Property="Margin" Value="0" />
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>

	<Grid x:Name="grid">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="0.33*"/>
			<ColumnDefinition Width="0.33*"/>
			<ColumnDefinition Width="0.33*"/>
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="0.45*"/>
			<RowDefinition Height="165"/>
			<RowDefinition Height="0.55*"/>
		</Grid.RowDefinitions>
		<Grid x:Name="grdBanner" Grid.Row="1" Grid.ColumnSpan="3">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="0.207*"/>
				<ColumnDefinition Width="0.793*"/>
			</Grid.ColumnDefinitions>
			<Border x:Name="brdHeader" BorderThickness="0" Margin="0" d:LayoutOverrides="Height" Grid.ColumnSpan="2" Background="DimGray" SnapsToDevicePixels="True"/>
			<TextBlock x:Name="tbCourseDescription" TextWrapping="Wrap" Text="Здесь краткое описание курса" Margin="0,10,10,10" FontSize="16" Foreground="White" TextOptions.TextFormattingMode="Display" d:LayoutOverrides="Height" Grid.Column="1"/>
			<Image Margin="10,10,10,-2" Source="/HeritageAcademy.Library;component/Images/TestBoardClipart1.png" ClipToBounds="True" Stretch="Fill"/>
		</Grid>
		<TextBlock x:Name="tbCourseTitle" Text="Основы всех современных языков программирования" VerticalAlignment="Bottom" Margin="20,0,0,-9" FontSize="34.667" TextTrimming="CharacterEllipsis" Grid.ColumnSpan="3">
			<TextBlock.Foreground>
				<SolidColorBrush Color="{DynamicResource SelectionColor}"/>
			</TextBlock.Foreground>
		</TextBlock>
		<Button x:Name="btnTest" Content="Тестирование" Style="{DynamicResource StartCourseButtonStyle}" Foreground="White" FontSize="16" TextOptions.TextFormattingMode="Display" Height="33" Margin="0,0,0,20" VerticalAlignment="Bottom" Grid.Row="2" Width="140" HorizontalAlignment="Center"/>
		<Button x:Name="btnStart" Content="Продолжить" Height="33" Style="{DynamicResource StartCourseButtonStyle}" Foreground="White" FontSize="16" TextOptions.TextFormattingMode="Display" VerticalAlignment="Bottom" Grid.Column="2" Margin="0,0,0,20" Grid.Row="2" Width="140"/>
		<StackPanel Grid.Column="1" Orientation="Vertical" d:LayoutOverrides="GridBox" VerticalAlignment="Center" Grid.ColumnSpan="2" HorizontalAlignment="Right">
			<TextBlock TextWrapping="Wrap" Text="На освоение вам потребуется" FontSize="16" Foreground="#FFBCBCBC"/>
			<StackPanel x:Name="spDuration" Margin="0" Orientation="Horizontal">
				<TextBlock x:Name="tbW" Text="3" FontSize="96" FontWeight="Medium" SnapsToDevicePixels="True" Foreground="#FFBCBCBC"/>
				<TextBlock x:Name="tbWCaption" Margin="0" TextWrapping="Wrap" Text="недели" VerticalAlignment="Bottom" Foreground="#FFBABABA" HorizontalAlignment="Right" FontSize="26.667" TextOptions.TextFormattingMode="Display"/>
				<TextBlock x:Name="tbD" Text="4" FontSize="96" FontWeight="Medium" SnapsToDevicePixels="True" Foreground="#FFBCBCBC"/>
				<TextBlock x:Name="tbDCaption" Margin="0" TextWrapping="Wrap" Text="дня" VerticalAlignment="Bottom" Foreground="#FFBABABA" HorizontalAlignment="Right" FontSize="26.667" TextOptions.TextFormattingMode="Display"/>
				<TextBlock x:Name="tbH" Text="1" FontSize="96" FontWeight="Medium" SnapsToDevicePixels="True" Foreground="#FFBCBCBC" d:LayoutOverrides="Height"/>
				<TextBlock x:Name="tbHCaption" Margin="0" TextWrapping="Wrap" Text="час" VerticalAlignment="Bottom" Foreground="#FFBABABA" HorizontalAlignment="Right" FontSize="26.667" TextOptions.TextFormattingMode="Display"/>
				<TextBlock x:Name="tbM" Text="45" FontSize="96" FontWeight="Medium" SnapsToDevicePixels="True" Foreground="#FFBCBCBC"/>
				<TextBlock x:Name="tbMCaption" Margin="0" TextWrapping="Wrap" Text="минут" VerticalAlignment="Bottom" Foreground="#FFBABABA" HorizontalAlignment="Right" FontSize="26.667" TextOptions.TextFormattingMode="Display"/>
			</StackPanel>
			<TextBlock x:Name="tbDurationBottomCaption" TextWrapping="Wrap" Text="из расчета 9 минут на параграф" Foreground="#FFBCBCBC" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="18.667" Margin="0,10,0,0"/>
		</StackPanel>
		<StackPanel x:Name="spTests" Margin="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal">
			<TextBlock x:Name="tbTestsCounter" TextWrapping="Wrap" FontSize="125.333" Margin="0" Foreground="#FFBCBCBC" Text="13"/>
			<TextBlock x:Name="tbTestsCounterCaption" TextWrapping="Wrap" Text="опросников" Margin="0" d:LayoutOverrides="Width" Foreground="#FFBCBCBC" FontSize="26.667" VerticalAlignment="Bottom"/>
            <TextBlock x:Name="tbNoTests" FontSize="14" Margin="0" Foreground="#FFBCBCBC" Visibility="Collapsed">
                <Run Text="Тестов нет, но можно"/>
                <Hyperlink NavigateUri="http://www.heritage-academy.ru/courses" RequestNavigate="Hyperlink_RequestNavigate">скачать</Hyperlink>
            </TextBlock>
        </StackPanel>
		<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="ОГЛАВЛЕНИЕ" VerticalAlignment="Top" Grid.Column="1" Margin="0,-9,0,0" Grid.Row="2" Foreground="DimGray" FontSize="24" d:LayoutOverrides="VerticalAlignment" FontWeight="Bold"/>
		<ScrollViewer MaxHeight="325" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" CanContentScroll="True" Margin="0,47,0,20" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Center">
			<ItemsControl ItemsSource="{Binding Chapters}">
				<ItemsControl.ItemTemplate>
					<DataTemplate>
						<Label Content="{Binding .}" FontWeight="Normal" FontSize="12" Margin="0">
							<Label.ContentTemplate>
								<DataTemplate>
									<Grid Margin="20,0,0,0" HorizontalAlignment="Left" >
										<Grid.ColumnDefinitions>
											<ColumnDefinition Width="*" />
											<ColumnDefinition Width="Auto" />
										</Grid.ColumnDefinitions>
										<TextBlock FontWeight="Normal" Foreground="Black" FontSize="11"  Text="{Binding Model.Title}" TextTrimming="CharacterEllipsis" />
										<TextBlock x:Name="PageNumberText" Grid.Column="1" FontWeight="Normal"  FontSize="11"  Foreground="#50FFFFFF" Text="{Binding CurrentPageNumber, StringFormat='  (Страница \{0\})'}" />
									</Grid>
									<DataTemplate.Triggers>
										<DataTrigger Binding="{Binding CurrentPageNumber}" Value="{x:Null}">
											<Setter TargetName="PageNumberText" Property="Visibility" Value="Collapsed" />
										</DataTrigger>
									</DataTemplate.Triggers>
								</DataTemplate>
							</Label.ContentTemplate>
						</Label>
					</DataTemplate>
				</ItemsControl.ItemTemplate>
			</ItemsControl>
		</ScrollViewer>
		<StackPanel x:Name="spLevels" Grid.Column="2" Orientation="Horizontal" Grid.Row="2" d:LayoutOverrides="Height" HorizontalAlignment="Center" VerticalAlignment="Center">
			<HeritageAcademy_Library:NaturalNumberSelector x:Name="nnsLevelSelector" CurrentValue="1" MaxValue="4" MinValue="1"/>
			<TextBlock x:Name="tbLevelSelectorCaption" TextWrapping="Wrap" Text="уровень" VerticalAlignment="Bottom" HorizontalAlignment="Center" FontSize="26.667" TextOptions.TextFormattingMode="Display" Foreground="#FFBCBCBC"/>
		</StackPanel>
	</Grid>
</UserControl>